{% extends "base.html" %}
{% block content_header %}
<h1>{{ app.app_name}}</h1>
{% endblock %}
{% block content_body %}
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="callout callout-warning">
    <ul>
        {% for message in messages %}
        <li><h4>{{ message }}</h4></li>
        {% endfor %}
    </ul>
</div>
{% endif %}
{% endwith %}
<div class="box">
    <div class="box-body">
<a class="btn btn-app" href="/app/page/{{ app.id }}"><i class="fa fresh"></i>刷新</a>
                <button class="btn btn-app" onclick="getPage('{{app.id}}')"><i class="fa fa-plus"></i>添加页面</button>
                <script>
                    function getPage(app_id) {
                        $.get('/deviceScreenShot/'+app_id,function (data) {

                        });
                    }

                    function getPoint(event) {
                        console.log(event);
                        var x = $(event.target).offsetLeft ;
                        var y = $(event.target).offsetTop;
                        alert(x+"--"+y );
                    }
                </script>

    </div>
</div>
    <div class="box">
            <div class="box-header">
              <h3 class="box-title">{{ app.app_name}}</h3>
            </div>
            <div class="box-body">
                <div class="row">
               {% for tpage in page_list %}
                    <div class="col-md-2">
                <img src="/images/{{ tpage.app_id   }}/{{ tpage.page_id }}" alt="{{ tpage.page_name}}" width="199" height="400" onclick="getPoint(event)">
              </div>
                {% endfor %}
             </div>

            </div>
    </div>
{% endblock %}

